<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>系统管理</title>
    <%@ include file="/common/util.jsp" %>
    <script type="text/javascript">

        function jumpPage(pageIndex) {
            window.location.href = "${cdnctx}/system/login/loginList.shtml?pageIndex=" + pageIndex;
        }
        var obj = {
            addLogin: function () {
                window.location.href = "${cdnctx}/system/login/editLoginInit.shtml";
            },
            updateLogin: function (loginid) {
                window.location.href = "${cdnctx}/system/login/editLoginInit.shtml?id=" + loginid;
            },
            searchResert: function () {
                window.location.href = "${cdnctx}/system/login/loginList.shtml?username=" + $("#searchUserName").val();
            },
            deleteLogin: function (loginid, modifyStamp) {
                dialog_confirmled("确定删除吗？", function () {
                    window.location.href = "${cdnctx}/system/login/delete.shtml?id=" + loginid;
                });
            },
            agentLogin: function (loginid) {
                window.location.href = "${cdnctx}/system/login/agentLoginList.shtml?loginId=" + loginid;
            },
        }
    </script>
</head>
<body class="main">
<div class="-frame -style -luster" id="css_container">
    <!--首页框架页眉部分↓-->
    <%@ include file="/WEB-INF/pages/inc/header.jsp" %>
    <!--首页框架页眉部分↑-->

    <div class="content">

        <!-- Left导航菜单◎开始 -->
        <%@ include file="/WEB-INF/pages/inc/leftmenu.jsp" %>
        <!-- Left导航菜单◎结束 -->

        <div class="main-mid">
            <div class="pos"><img src="${cdnctx}/src/index/img/index.png"><a
                    href="<%--${cdnctx}/system/systemMenu.shtml--%>">系统管理 ></a><a
                    href="${cdnctx}/system/login/loginList.shtml">用户表管理</a></div>
            <div class="css_contentDiv">
                <form id="searchLoginForm" action="${cdnctx}/system/login/loginList.shtml" method="post">
                    <div style="padding:10px;">
                        <label class="search_text">公司番号：</label>
                        <input id="companycode" name="companycode" type="text" class="search_input"/>
                        <label class="search_text">公司名：</label>
                        <input id="customername" name="customername" type="text" class="search_input"/>
                        <label class="search_text">用户名：</label>
                        <input id="searchUserName" name="username" type="text" class="search_input"/>
                        <input type="submit" class="search_btn" value="查&nbsp;询"/>
                        <input type="reset" class="reset_btn" value="重&nbsp;置"/>
                        <input type="button" class="add_btn" value="新&nbsp;增" onclick="obj.addLogin()"/>
                    </div>
                </form>
                <div class="divTable">
                    <div style="height:375px;background-color:white">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table">
                            <thead>
                            <tr>
                                <td>集团番号</td>
                                <td>集团名</td>
                                <td>公司番号</td>
                                <td>公司名</td>
                                <td>用户名</td>
                                <td>角色</td>
                                <td>公司信息</td>
                                <td>添加者</td>
                                <td>添加时间</td>
                                <td>备注</td>
                                <td>操作</td>
                            </tr>
                            </thead>
                            <c:if test="${empty(list) }">
                                <tr class="even" style="color:red">
                                    <td colspan="8" class="no-data" style="height: 300px;"></td>
                                </tr>
                            </c:if>
                            <c:if test="${not empty(list) }">
                                <c:forEach items="${list}" var="entity" varStatus="status">
                                    <tr>
                                        <td>${entity.groupcode}</td>
                                        <td>${entity.groupname}</td>
                                        <td>${entity.companycode}</td>
                                        <td>${entity.customername}</td>
                                        <td>${entity.username}</td>
                                        <td>${entity.roleName}</td>
                                        <td><a href="${cdnctx}/system/login/loginMessageInit.shtml?loginid=${entity.id}">
                                            操作(
                                            <c:choose>
                                                <c:when test="${entity.descriptionState==0}">使用</c:when>
                                                <c:when test="${entity.descriptionState==1}">禁用</c:when>
                                                <c:otherwise>暂无</c:otherwise>
                                            </c:choose>
                                            )
                                        </a></td>
                                        <td>${entity.addby}</td>
                                        <td>${entity.adddate}</td>
                                        <td>${entity.memo}</td>
                                        <td>
                                            <input id='newbutton' type='button' class='list_update_btn'
                                                   onclick='obj.updateLogin(${entity.id})' value='修改'/>
                                            <input id='newbutton' type='button' class='list_delete_btn'
                                                   onclick='obj.deleteLogin(${entity.id},"${entity.modifystamp}")'
                                                   value='删除'/>
                                            <%--<c:if test="${entity.roletype == 2 }">--%>
                                                <%--<input id='newbutton' type='button' class='list_next_btn'--%>
                                                       <%--onclick='obj.agentLogin(${entity.id})' value='查看下级'/>--%>
                                            <%--</c:if>--%>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                        </table>
                    </div>
                    <c:if test="${not empty(list) }">
                        <div id="pageInfo" class="pageJump">
                            <script type="text/javascript">
                                pagination.getPaginationHtml('JavaScript:jumpPage({0})', ${pageIndex}, ${pageCount}, 'pageInfo');
                            </script>
                            <c:if test="${!empty(list) }">
                                共有${dataCount}条数据
                            </c:if>
                        </div>
                    </c:if>

                </div>
            </div>
        </div>

    </div>

    <!--首页框架页尾部分↓-->
    <%@ include file="/WEB-INF/pages/inc/footer.jsp" %>
    <!--首页框架页尾部分↑-->
</div>
</body>
</html>